<template>
  <div>
    <input type="text" :value="modelValue" @input="updateValue($event.target.value)" />
  </div>
</template>

<!-- <script>
export default {
  name: 'MyInput',
  props: {
    modelValue: {
      type: String,
      default: ''
    }
  },
  methods: {
    updateValue(value) {
      this.$emit('update:modelValue', value)
    }
  }
}
</script> -->
<script setup>
defineOptions({
  name: 'MyInput'
})
defineProps({
  modelValue: {
    type: String,
    default: ''
  }
})
const emit = defineEmits(['update:modelValue'])

const updateValue = (value) => {
  emit('update:modelValue', value)
}
</script>
